#!/usr/bin/env python3
# -*- coding: utf-8 -*-

' a test module '

__author__ = " Joe"

class Student(object):
    def __init__(self,name,score):
        self.__name = name
        self.__score = score
    def print_score(self):
        print("name: %s  ---  score: %s" % (self.__name, self.__score))
    def get_grade(self):
        if self.__score >= 90:
            return 'A'
        elif self.__score >= 60:
            return 'B'
        else:
            return 'C'
    def set_score(self,score):
        if 0 <= score <= 100:
            self.__score = score
        else:
            raise ValueError("bad score")

    def __getattr__(self, attr):
        if attr=='score':
            return 99
        if attr=='age':
            return lambda: 25

    def __str__(self, *args, **kwargs):
        return "i'm a student"
    __repr__ = __str__


lisa = Student("lisa",88)
joe = Student("joe",100)

print(Student)
print(lisa)
print(joe)
print(joe.score)
print(joe.age)
print(joe.age())

